<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../../../print.css" type="text/css" media="print">
<meta content="Viewport,com.derschmale.wick3d.view.Viewport,aspectRatio,centerX,centerY,viewportHeight,viewportWidth,clear,getTopTriangleUnderPoint,getTrianglesUnderPoint" name="keywords">
<title>com.derschmale.wick3d.view.Viewport</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'Viewport - Wick3d Documentation';
				var baseRef = '../../../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">Wick3d Documentation</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../all-classes.html')" href="../../../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../../../index-list.html')" href="../../../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../../../index.html?com/derschmale/wick3d/view/Viewport.html&amp;com/derschmale/wick3d/view/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;Viewport</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class Viewport"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">com.derschmale.wick3d.view</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class Viewport</td>
</tr>
<tr>
<td class="classHeaderTableLabel">Inheritance</td><td class="inheritanceList">Viewport <img class="inheritArrow" alt="Inheritance" title="Inheritance" src="../../../../images/inherit-arrow.gif"> flash.display.Sprite</td>
</tr>
</table>
<p></p>
  The Viewport class is used as the target on the stage to render to. It can be seen as a window through which we view the three-dimensional world.
  
  <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#aspectRatio">aspectRatio</a> : Number<div class="summaryTableDescription">[read-only]
   The aspect ratio of the viewport.</div>
</td><td class="summaryTableOwnerCol">Viewport</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#centerX">centerX</a> : Number<div class="summaryTableDescription">[read-only]
   The x-component of the center of the viewport.</div>
</td><td class="summaryTableOwnerCol">Viewport</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#centerY">centerY</a> : Number<div class="summaryTableDescription">[read-only]
   The y-component of the center of the viewport.</div>
</td><td class="summaryTableOwnerCol">Viewport</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#viewportHeight">viewportHeight</a> : Number<div class="summaryTableDescription">
   The height of the viewport in pixels.</div>
</td><td class="summaryTableOwnerCol">Viewport</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#viewportWidth">viewportWidth</a> : Number<div class="summaryTableDescription">
   The width of the viewport in pixels.</div>
</td><td class="summaryTableOwnerCol">Viewport</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#Viewport()">Viewport</a>(alignToStage:Boolean = false, width:Number = 800, height:Number = 600)</div>
<div class="summaryTableDescription">
   Creates a new Viewport
   
   </div>
</td><td class="summaryTableOwnerCol">Viewport</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#clear()">clear</a>():void</div>
<div class="summaryTableDescription">
   Removes all previously drawn graphics in the viewport.</div>
</td><td class="summaryTableOwnerCol">Viewport</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getTopTriangleUnderPoint()">getTopTriangleUnderPoint</a>(x:Number, y:Number, onlyInteractive:Boolean = false):<a href="../core/geometry/Triangle3D.html">Triangle3D</a>
</div>
<div class="summaryTableDescription">
   Returns the top-most (closest to the viewer) of all rendered triangles under the specified point (in viewport coordinates).</div>
</td><td class="summaryTableOwnerCol">Viewport</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getTrianglesUnderPoint()">getTrianglesUnderPoint</a>(x:Number, y:Number, onlyInteractive:Boolean = false):Array</div>
<div class="summaryTableDescription">
   Return an Array of all rendered triangles under the specified point (in viewport coordinates).</div>
</td><td class="summaryTableOwnerCol">Viewport</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="aspectRatio"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">aspectRatio</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>aspectRatio:Number</code>&nbsp;&nbsp;[read-only]<p>
   The aspect ratio of the viewport. It is defined as _viewportHeight/_viewportWidth.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get aspectRatio():Number</code>
<br>
</div>
<a name="centerX"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">centerX</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>centerX:Number</code>&nbsp;&nbsp;[read-only]<p>
   The x-component of the center of the viewport. It is defined as _viewportWidth/2
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get centerX():Number</code>
<br>
</div>
<a name="centerY"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">centerY</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>centerY:Number</code>&nbsp;&nbsp;[read-only]<p>
   The y-component of the center of the viewport. It is defined as _viewportHeight/2
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get centerY():Number</code>
<br>
</div>
<a name="viewportHeight"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">viewportHeight</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>viewportHeight:Number</code>&nbsp;&nbsp;[read-write]<p>
   The height of the viewport in pixels. This parameter will be ignored if alignToStage is set to true.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get viewportHeight():Number</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set viewportHeight(value:Number):void</code>
<br>
</div>
<a name="viewportWidth"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">viewportWidth</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>viewportWidth:Number</code>&nbsp;&nbsp;[read-write]<p>
   The width of the viewport in pixels. This parameter will be ignored if alignToStage is set to true.
   </p><span class="label">Implementation</span>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function get viewportWidth():Number</code>
<br>
<code>&nbsp;&nbsp;&nbsp;&nbsp;public function set viewportWidth(value:Number):void</code>
<br>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="Viewport()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">Viewport</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function Viewport(alignToStage:Boolean = false, width:Number = 800, height:Number = 600)</code><p>
   Creates a new Viewport
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">alignToStage</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; Specifies whether the viewport should be automatically resized to the stage.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">width</span>:Number</code> (default = <code>800</code>)<code></code> &mdash; The width of the viewport in pixels. This parameter will be ignored if alignToStage is set to true.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">height</span>:Number</code> (default = <code>600</code>)<code></code> &mdash; The height of the viewport in pixels. This parameter will be ignored if alignToStage is set to true.
   </td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="clear()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">clear</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function clear():void</code><p>
   Removes all previously drawn graphics in the viewport. This is typically called at the beginning of the drawing loop of the RenderPipeline.
   </p></div>
<a name="getTopTriangleUnderPoint()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getTopTriangleUnderPoint</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getTopTriangleUnderPoint(x:Number, y:Number, onlyInteractive:Boolean = false):<a href="../core/geometry/Triangle3D.html">Triangle3D</a></code><p>
   Returns the top-most (closest to the viewer) of all rendered triangles under the specified point (in viewport coordinates).
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">x</span>:Number</code> &mdash; The x coordinate of the point.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">y</span>:Number</code> &mdash; The y coordinate of the point.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">onlyInteractive</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; If true, triangles whose material aren't interactive are ignored. Otherwise, all triangles are considered.
   
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../core/geometry/Triangle3D.html">Triangle3D</a></code> &mdash; 
                        The top-most Triangle3D instance that contain the (x, y) point.
   
   
                        
                     </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../core/geometry/Triangle3D.html" target="">com.derschmale.wick3d.core.geometry.Triangle3D</a>
</div>
</div>
<a name="getTrianglesUnderPoint()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getTrianglesUnderPoint</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getTrianglesUnderPoint(x:Number, y:Number, onlyInteractive:Boolean = false):Array</code><p>
   Return an Array of all rendered triangles under the specified point (in viewport coordinates).
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">x</span>:Number</code> &mdash; The x coordinate of the point.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">y</span>:Number</code> &mdash; The y coordinate of the point.
   </td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">onlyInteractive</span>:Boolean</code> (default = <code>false</code>)<code></code> &mdash; If true, triangles whose material aren't interactive are ignored. Otherwise, all triangles are considered.
   
   </td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code> &mdash; An Array of rendered Triangle3D instances that contain the (x, y) point.
   
   </td>
</tr>
</table>
<p>
<span class="label">See also</span>
</p>
<div class="seeAlso">
<a href="../core/geometry/Triangle3D.html" target="">com.derschmale.wick3d.core.geometry.Triangle3D</a>
</div>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
